package org.zoomdev.zoom.aop.factory;

import org.zoomdev.zoom.aop.Setter;
import org.zoomdev.zoom.aop.factory.impl.SetterFactoryImpl;

import java.lang.reflect.Field;

public interface SetterFactory {

    SetterFactory FACTORY = new SetterFactoryImpl(SetterFactory.class.getClassLoader());

    static Setter[] create(Field[] fields) {
        int l = fields.length;
        Setter[] setters = new Setter[l];
        for (int i = 0; i < l; ++i) {
            setters[i] = FACTORY.create(fields[i]);
        }
        return setters;
    }

    Setter create(Field field);
}
